package com.xdw.permissionslib.lazysample;

import com.xdw.permissionslib.lazysample.slice.MainAbilitySlice;
import com.xdw.permissionslib.mylibrary.LazyPermissionAblity;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.security.SystemPermission;

public class MainAbility extends LazyPermissionAblity {
    //定义需要动态申请的权限组，可以是一个或多个权限。这里的权限还必须要在config.json中进行配置
    private String[] permissions = {
            // 存储权限
            SystemPermission.WRITE_USER_STORAGE,
            // 相机权限
            SystemPermission.CAMERA
    };
    @Override
    public void onStart(Intent intent) {
        //lazy模式下，setPermissions的代码调用必须放在onStart的第一行
        super.setPermissions(permissions);
        super.onStart(intent);
        super.setMainRoute(MainAbilitySlice.class.getName());
    }
}
